//
//  TableViewCell.swift
//  AppArchitectureSwift
//
//  Created by 胡锦涛 on 2019/2/20.
//  Copyright © 2019 胡锦涛. All rights reserved.
//

import UIKit

class TableViewCell: UITableViewCell {

    var titleLabel: UILabel!
    var model:User?
   
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setupUI()
    }
    func setupUI(){
        self.titleLabel = UILabel(CGRect(x: 10, y: 0, width: self.hk_width - 2*10, height: self.hk_height), font: HKFont(14), textColor: HK_RandomColor(), text: "", textAlignment: .left, superView: self.contentView)
        
    }
    
    //赋值操作
    func setModel(_ model:User){
        self.model = model
        self.titleLabel.text = self.model?.name
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
